package com.macro.mall.portal.domain;

import com.macro.mall.common.utils.EncryptUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;


/**
 * @author super
 * @title: MemberVO
 * @description: TODO
 * @date 2020/8/7 12:27
 */

@Data
public class MemberVO {

    @ApiModelProperty(value = "手机号", required = true, position = 0)
    private String username;
    @ApiModelProperty(value = "手机号", required = true, position = 0)
    private String phone;
    @ApiModelProperty(value = "旧密码", required = false, position = 1)
    private String oldPassword;
    @ApiModelProperty(value = "密码", required = false, position = 1)
    private String password;
    @ApiModelProperty(value = "验证码", required = false, position = 2)
    private String code;
    @ApiModelProperty(value = "姓名", required = false, position = 3)
    private String name;
    @ApiModelProperty(value = "性别：0->未知；1->男；2->女", required = false, position = 3)
    private Integer gender;
    @ApiModelProperty(value = "身份证号码", required = false, position = 4)
    private String idCard;
    @ApiModelProperty(value = "省份", required = false, position = 5)
    private String province;
    @ApiModelProperty(value = "所在城市", required = false, position = 6)
    private String cityCode;
    @ApiModelProperty(value = "区", required = false, position = 7)
    private String countyCode;
    @ApiModelProperty(value = "楼号", required = false, position = 8)
    private String floor;
    @ApiModelProperty(value = "社区标识", required = false, position = 8)
    private Integer communityId;
    @ApiModelProperty(value = "社区名称", required = false, position = 9)
    private String communityName;

    @ApiModelProperty(value = "用户身份 01-居民 02-居委会 03-物业公司 04-业委会 05-物管会 06-管理员 07-供应商 08-政府组织 09-其他", required = false, position = 10)
    private String userIdentity;

    @ApiModelProperty(value = "微信用户标识", required = false, position = 11)
    private String openId;

    @ApiModelProperty(value = "是否是用户补全信息页 0-否 1-是", required = false, position = 12)
    private Integer completePage;

    public void setPassword(String password) throws Exception {
        this.password = EncryptUtil.aesDecrypt(password,EncryptUtil.KEY);
    }


    public void setOldPassword(String oldPassword) throws Exception {
        this.oldPassword = EncryptUtil.aesDecrypt(oldPassword,EncryptUtil.KEY);
    }

}
